"""
    Pinterest REST API

    Pinterest's REST API  # noqa: E501

    The version of the OpenAPI document: 5.6.0
    Contact: pinterest-api@pinterest.com
    Generated by: https://openapi-generator.tech
"""


import re  # noqa: F401
import sys  # noqa: F401

from pinterest.generated.client.api_client import ApiClient, Endpoint as _Endpoint
from pinterest.generated.client.model_utils import (  # noqa: F401
    check_allowed_values,
    check_validations,
    date,
    datetime,
    file_type,
    none_type,
    validate_and_convert_types
)
from pinterest.generated.client.model.ad_array_response import AdArrayResponse
from pinterest.generated.client.model.ad_create_request import AdCreateRequest
from pinterest.generated.client.model.ad_preview_request import AdPreviewRequest
from pinterest.generated.client.model.ad_preview_url_response import AdPreviewURLResponse
from pinterest.generated.client.model.ad_response import AdResponse
from pinterest.generated.client.model.ad_update_request import AdUpdateRequest
from pinterest.generated.client.model.ads_analytics_response import AdsAnalyticsResponse
from pinterest.generated.client.model.ads_analytics_targeting_type import AdsAnalyticsTargetingType
from pinterest.generated.client.model.conversion_report_attribution_type import ConversionReportAttributionType
from pinterest.generated.client.model.error import Error
from pinterest.generated.client.model.granularity import Granularity
from pinterest.generated.client.model.metrics_response import MetricsResponse
from pinterest.generated.client.model.paginated import Paginated


class AdsApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client
        self.ad_previews_create_endpoint = _Endpoint(
            settings={
                'response_type': (AdPreviewURLResponse,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}/ad_previews',
                'operation_id': 'ad_previews_create',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                    'ad_preview_request',
                ],
                'required': [
                    'ad_account_id',
                    'ad_preview_request',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                    'ad_account_id',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                    'ad_preview_request':
                        (AdPreviewRequest,),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                },
                'location_map': {
                    'ad_account_id': 'path',
                    'ad_preview_request': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client
        )
        self.ad_targeting_analytics_get_endpoint = _Endpoint(
            settings={
                'response_type': (MetricsResponse,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}/ads/targeting_analytics',
                'operation_id': 'ad_targeting_analytics_get',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                    'ad_ids',
                    'start_date',
                    'end_date',
                    'targeting_types',
                    'columns',
                    'granularity',
                    'click_window_days',
                    'engagement_window_days',
                    'view_window_days',
                    'conversion_report_time',
                    'attribution_types',
                ],
                'required': [
                    'ad_account_id',
                    'ad_ids',
                    'start_date',
                    'end_date',
                    'targeting_types',
                    'columns',
                    'granularity',
                ],
                'nullable': [
                ],
                'enum': [
                    'columns',
                    'click_window_days',
                    'engagement_window_days',
                    'view_window_days',
                    'conversion_report_time',
                ],
                'validation': [
                    'ad_account_id',
                    'ad_ids',
                    'targeting_types',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                    ('ad_ids',): {

                        'max_items': 100,
                        'min_items': 1,
                    },
                    ('targeting_types',): {

                        'max_items': 15,
                        'min_items': 1,
                    },
                },
                'allowed_values': {
                    ('columns',): {

                        "ADVERTISER_ID": "ADVERTISER_ID",
                        "PIN_PROMOTION_ID": "PIN_PROMOTION_ID",
                        "AD_ACCOUNT_ID": "AD_ACCOUNT_ID",
                        "AD_GROUP_ENTITY_STATUS": "AD_GROUP_ENTITY_STATUS",
                        "AD_GROUP_ID": "AD_GROUP_ID",
                        "AD_ID": "AD_ID",
                        "CAMPAIGN_DAILY_SPEND_CAP": "CAMPAIGN_DAILY_SPEND_CAP",
                        "CAMPAIGN_ENTITY_STATUS": "CAMPAIGN_ENTITY_STATUS",
                        "CAMPAIGN_ID": "CAMPAIGN_ID",
                        "CAMPAIGN_LIFETIME_SPEND_CAP": "CAMPAIGN_LIFETIME_SPEND_CAP",
                        "CAMPAIGN_NAME": "CAMPAIGN_NAME",
                        "CHECKOUT_ROAS": "CHECKOUT_ROAS",
                        "CLICKTHROUGH_1": "CLICKTHROUGH_1",
                        "CLICKTHROUGH_1_GROSS": "CLICKTHROUGH_1_GROSS",
                        "CLICKTHROUGH_2": "CLICKTHROUGH_2",
                        "CPC_IN_MICRO_DOLLAR": "CPC_IN_MICRO_DOLLAR",
                        "CPM_IN_DOLLAR": "CPM_IN_DOLLAR",
                        "CPM_IN_MICRO_DOLLAR": "CPM_IN_MICRO_DOLLAR",
                        "CTR": "CTR",
                        "CTR_2": "CTR_2",
                        "ECPCV_IN_DOLLAR": "ECPCV_IN_DOLLAR",
                        "ECPCV_P95_IN_DOLLAR": "ECPCV_P95_IN_DOLLAR",
                        "ECPC_IN_DOLLAR": "ECPC_IN_DOLLAR",
                        "ECPC_IN_MICRO_DOLLAR": "ECPC_IN_MICRO_DOLLAR",
                        "ECPE_IN_DOLLAR": "ECPE_IN_DOLLAR",
                        "ECPM_IN_MICRO_DOLLAR": "ECPM_IN_MICRO_DOLLAR",
                        "ECPV_IN_DOLLAR": "ECPV_IN_DOLLAR",
                        "ECTR": "ECTR",
                        "EENGAGEMENT_RATE": "EENGAGEMENT_RATE",
                        "ENGAGEMENT_1": "ENGAGEMENT_1",
                        "ENGAGEMENT_2": "ENGAGEMENT_2",
                        "ENGAGEMENT_RATE": "ENGAGEMENT_RATE",
                        "IDEA_PIN_PRODUCT_TAG_VISIT_1": "IDEA_PIN_PRODUCT_TAG_VISIT_1",
                        "IDEA_PIN_PRODUCT_TAG_VISIT_2": "IDEA_PIN_PRODUCT_TAG_VISIT_2",
                        "IMPRESSION_1": "IMPRESSION_1",
                        "IMPRESSION_1_GROSS": "IMPRESSION_1_GROSS",
                        "IMPRESSION_2": "IMPRESSION_2",
                        "INAPP_CHECKOUT_COST_PER_ACTION": "INAPP_CHECKOUT_COST_PER_ACTION",
                        "OUTBOUND_CLICK_1": "OUTBOUND_CLICK_1",
                        "OUTBOUND_CLICK_2": "OUTBOUND_CLICK_2",
                        "PAGE_VISIT_COST_PER_ACTION": "PAGE_VISIT_COST_PER_ACTION",
                        "PAGE_VISIT_ROAS": "PAGE_VISIT_ROAS",
                        "PAID_IMPRESSION": "PAID_IMPRESSION",
                        "PIN_ID": "PIN_ID",
                        "REPIN_1": "REPIN_1",
                        "REPIN_2": "REPIN_2",
                        "REPIN_RATE": "REPIN_RATE",
                        "SPEND_IN_DOLLAR": "SPEND_IN_DOLLAR",
                        "SPEND_IN_MICRO_DOLLAR": "SPEND_IN_MICRO_DOLLAR",
                        "TOTAL_CHECKOUT": "TOTAL_CHECKOUT",
                        "TOTAL_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CLICKTHROUGH": "TOTAL_CLICKTHROUGH",
                        "TOTAL_CLICK_ADD_TO_CART": "TOTAL_CLICK_ADD_TO_CART",
                        "TOTAL_CLICK_CHECKOUT": "TOTAL_CLICK_CHECKOUT",
                        "TOTAL_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CLICK_LEAD": "TOTAL_CLICK_LEAD",
                        "TOTAL_CLICK_SIGNUP": "TOTAL_CLICK_SIGNUP",
                        "TOTAL_CLICK_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_CLICK_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CONVERSIONS": "TOTAL_CONVERSIONS",
                        "TOTAL_CUSTOM": "TOTAL_CUSTOM",
                        "TOTAL_ENGAGEMENT": "TOTAL_ENGAGEMENT",
                        "TOTAL_ENGAGEMENT_CHECKOUT": "TOTAL_ENGAGEMENT_CHECKOUT",
                        "TOTAL_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_ENGAGEMENT_LEAD": "TOTAL_ENGAGEMENT_LEAD",
                        "TOTAL_ENGAGEMENT_SIGNUP": "TOTAL_ENGAGEMENT_SIGNUP",
                        "TOTAL_ENGAGEMENT_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_ENGAGEMENT_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_IDEA_PIN_PRODUCT_TAG_VISIT": "TOTAL_IDEA_PIN_PRODUCT_TAG_VISIT",
                        "TOTAL_IMPRESSION_FREQUENCY": "TOTAL_IMPRESSION_FREQUENCY",
                        "TOTAL_IMPRESSION_USER": "TOTAL_IMPRESSION_USER",
                        "TOTAL_LEAD": "TOTAL_LEAD",
                        "TOTAL_OFFLINE_CHECKOUT": "TOTAL_OFFLINE_CHECKOUT",
                        "TOTAL_PAGE_VISIT": "TOTAL_PAGE_VISIT",
                        "TOTAL_REPIN_RATE": "TOTAL_REPIN_RATE",
                        "TOTAL_SIGNUP": "TOTAL_SIGNUP",
                        "TOTAL_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_VIDEO_3SEC_VIEWS": "TOTAL_VIDEO_3SEC_VIEWS",
                        "TOTAL_VIDEO_AVG_WATCHTIME_IN_SECOND": "TOTAL_VIDEO_AVG_WATCHTIME_IN_SECOND",
                        "TOTAL_VIDEO_MRC_VIEWS": "TOTAL_VIDEO_MRC_VIEWS",
                        "TOTAL_VIDEO_P0_COMBINED": "TOTAL_VIDEO_P0_COMBINED",
                        "TOTAL_VIDEO_P100_COMPLETE": "TOTAL_VIDEO_P100_COMPLETE",
                        "TOTAL_VIDEO_P25_COMBINED": "TOTAL_VIDEO_P25_COMBINED",
                        "TOTAL_VIDEO_P50_COMBINED": "TOTAL_VIDEO_P50_COMBINED",
                        "TOTAL_VIDEO_P75_COMBINED": "TOTAL_VIDEO_P75_COMBINED",
                        "TOTAL_VIDEO_P95_COMBINED": "TOTAL_VIDEO_P95_COMBINED",
                        "TOTAL_VIEW_ADD_TO_CART": "TOTAL_VIEW_ADD_TO_CART",
                        "TOTAL_VIEW_CHECKOUT": "TOTAL_VIEW_CHECKOUT",
                        "TOTAL_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_VIEW_LEAD": "TOTAL_VIEW_LEAD",
                        "TOTAL_VIEW_SIGNUP": "TOTAL_VIEW_SIGNUP",
                        "TOTAL_VIEW_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_VIEW_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_CHECKOUT": "TOTAL_WEB_CHECKOUT",
                        "TOTAL_WEB_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_CLICK_CHECKOUT": "TOTAL_WEB_CLICK_CHECKOUT",
                        "TOTAL_WEB_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_ENGAGEMENT_CHECKOUT": "TOTAL_WEB_ENGAGEMENT_CHECKOUT",
                        "TOTAL_WEB_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_SESSIONS": "TOTAL_WEB_SESSIONS",
                        "TOTAL_WEB_VIEW_CHECKOUT": "TOTAL_WEB_VIEW_CHECKOUT",
                        "TOTAL_WEB_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "VIDEO_3SEC_VIEWS_2": "VIDEO_3SEC_VIEWS_2",
                        "VIDEO_LENGTH": "VIDEO_LENGTH",
                        "VIDEO_MRC_VIEWS_2": "VIDEO_MRC_VIEWS_2",
                        "VIDEO_P0_COMBINED_2": "VIDEO_P0_COMBINED_2",
                        "VIDEO_P100_COMPLETE_2": "VIDEO_P100_COMPLETE_2",
                        "VIDEO_P25_COMBINED_2": "VIDEO_P25_COMBINED_2",
                        "VIDEO_P50_COMBINED_2": "VIDEO_P50_COMBINED_2",
                        "VIDEO_P75_COMBINED_2": "VIDEO_P75_COMBINED_2",
                        "VIDEO_P95_COMBINED_2": "VIDEO_P95_COMBINED_2",
                        "WEB_CHECKOUT_COST_PER_ACTION": "WEB_CHECKOUT_COST_PER_ACTION",
                        "WEB_CHECKOUT_ROAS": "WEB_CHECKOUT_ROAS",
                        "WEB_SESSIONS_1": "WEB_SESSIONS_1",
                        "WEB_SESSIONS_2": "WEB_SESSIONS_2"
                    },
                    ('click_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('engagement_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('view_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('conversion_report_time',): {

                        "AD_ACTION": "TIME_OF_AD_ACTION",
                        "CONVERSION": "TIME_OF_CONVERSION"
                    },
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                    'ad_ids':
                        ([str],),
                    'start_date':
                        (date,),
                    'end_date':
                        (date,),
                    'targeting_types':
                        ([AdsAnalyticsTargetingType],),
                    'columns':
                        ([str],),
                    'granularity':
                        (Granularity,),
                    'click_window_days':
                        (int,),
                    'engagement_window_days':
                        (int,),
                    'view_window_days':
                        (int,),
                    'conversion_report_time':
                        (str,),
                    'attribution_types':
                        (ConversionReportAttributionType,),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                    'ad_ids': 'ad_ids',
                    'start_date': 'start_date',
                    'end_date': 'end_date',
                    'targeting_types': 'targeting_types',
                    'columns': 'columns',
                    'granularity': 'granularity',
                    'click_window_days': 'click_window_days',
                    'engagement_window_days': 'engagement_window_days',
                    'view_window_days': 'view_window_days',
                    'conversion_report_time': 'conversion_report_time',
                    'attribution_types': 'attribution_types',
                },
                'location_map': {
                    'ad_account_id': 'path',
                    'ad_ids': 'query',
                    'start_date': 'query',
                    'end_date': 'query',
                    'targeting_types': 'query',
                    'columns': 'query',
                    'granularity': 'query',
                    'click_window_days': 'query',
                    'engagement_window_days': 'query',
                    'view_window_days': 'query',
                    'conversion_report_time': 'query',
                    'attribution_types': 'query',
                },
                'collection_format_map': {
                    'ad_ids': 'multi',
                    'targeting_types': 'csv',
                    'columns': 'csv',
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.ads_analytics_endpoint = _Endpoint(
            settings={
                'response_type': (AdsAnalyticsResponse,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}/ads/analytics',
                'operation_id': 'ads_analytics',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                    'start_date',
                    'end_date',
                    'ad_ids',
                    'columns',
                    'granularity',
                    'click_window_days',
                    'engagement_window_days',
                    'view_window_days',
                    'conversion_report_time',
                ],
                'required': [
                    'ad_account_id',
                    'start_date',
                    'end_date',
                    'ad_ids',
                    'columns',
                    'granularity',
                ],
                'nullable': [
                ],
                'enum': [
                    'columns',
                    'click_window_days',
                    'engagement_window_days',
                    'view_window_days',
                    'conversion_report_time',
                ],
                'validation': [
                    'ad_account_id',
                    'ad_ids',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                    ('ad_ids',): {

                        'max_items': 100,
                        'min_items': 1,
                    },
                },
                'allowed_values': {
                    ('columns',): {

                        "ADVERTISER_ID": "ADVERTISER_ID",
                        "PIN_PROMOTION_ID": "PIN_PROMOTION_ID",
                        "AD_ACCOUNT_ID": "AD_ACCOUNT_ID",
                        "AD_GROUP_ENTITY_STATUS": "AD_GROUP_ENTITY_STATUS",
                        "AD_GROUP_ID": "AD_GROUP_ID",
                        "AD_ID": "AD_ID",
                        "CAMPAIGN_DAILY_SPEND_CAP": "CAMPAIGN_DAILY_SPEND_CAP",
                        "CAMPAIGN_ENTITY_STATUS": "CAMPAIGN_ENTITY_STATUS",
                        "CAMPAIGN_ID": "CAMPAIGN_ID",
                        "CAMPAIGN_LIFETIME_SPEND_CAP": "CAMPAIGN_LIFETIME_SPEND_CAP",
                        "CAMPAIGN_NAME": "CAMPAIGN_NAME",
                        "CHECKOUT_ROAS": "CHECKOUT_ROAS",
                        "CLICKTHROUGH_1": "CLICKTHROUGH_1",
                        "CLICKTHROUGH_1_GROSS": "CLICKTHROUGH_1_GROSS",
                        "CLICKTHROUGH_2": "CLICKTHROUGH_2",
                        "CPC_IN_MICRO_DOLLAR": "CPC_IN_MICRO_DOLLAR",
                        "CPM_IN_DOLLAR": "CPM_IN_DOLLAR",
                        "CPM_IN_MICRO_DOLLAR": "CPM_IN_MICRO_DOLLAR",
                        "CTR": "CTR",
                        "CTR_2": "CTR_2",
                        "ECPCV_IN_DOLLAR": "ECPCV_IN_DOLLAR",
                        "ECPCV_P95_IN_DOLLAR": "ECPCV_P95_IN_DOLLAR",
                        "ECPC_IN_DOLLAR": "ECPC_IN_DOLLAR",
                        "ECPC_IN_MICRO_DOLLAR": "ECPC_IN_MICRO_DOLLAR",
                        "ECPE_IN_DOLLAR": "ECPE_IN_DOLLAR",
                        "ECPM_IN_MICRO_DOLLAR": "ECPM_IN_MICRO_DOLLAR",
                        "ECPV_IN_DOLLAR": "ECPV_IN_DOLLAR",
                        "ECTR": "ECTR",
                        "EENGAGEMENT_RATE": "EENGAGEMENT_RATE",
                        "ENGAGEMENT_1": "ENGAGEMENT_1",
                        "ENGAGEMENT_2": "ENGAGEMENT_2",
                        "ENGAGEMENT_RATE": "ENGAGEMENT_RATE",
                        "IDEA_PIN_PRODUCT_TAG_VISIT_1": "IDEA_PIN_PRODUCT_TAG_VISIT_1",
                        "IDEA_PIN_PRODUCT_TAG_VISIT_2": "IDEA_PIN_PRODUCT_TAG_VISIT_2",
                        "IMPRESSION_1": "IMPRESSION_1",
                        "IMPRESSION_1_GROSS": "IMPRESSION_1_GROSS",
                        "IMPRESSION_2": "IMPRESSION_2",
                        "INAPP_CHECKOUT_COST_PER_ACTION": "INAPP_CHECKOUT_COST_PER_ACTION",
                        "OUTBOUND_CLICK_1": "OUTBOUND_CLICK_1",
                        "OUTBOUND_CLICK_2": "OUTBOUND_CLICK_2",
                        "PAGE_VISIT_COST_PER_ACTION": "PAGE_VISIT_COST_PER_ACTION",
                        "PAGE_VISIT_ROAS": "PAGE_VISIT_ROAS",
                        "PAID_IMPRESSION": "PAID_IMPRESSION",
                        "PIN_ID": "PIN_ID",
                        "REPIN_1": "REPIN_1",
                        "REPIN_2": "REPIN_2",
                        "REPIN_RATE": "REPIN_RATE",
                        "SPEND_IN_DOLLAR": "SPEND_IN_DOLLAR",
                        "SPEND_IN_MICRO_DOLLAR": "SPEND_IN_MICRO_DOLLAR",
                        "TOTAL_CHECKOUT": "TOTAL_CHECKOUT",
                        "TOTAL_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CLICKTHROUGH": "TOTAL_CLICKTHROUGH",
                        "TOTAL_CLICK_ADD_TO_CART": "TOTAL_CLICK_ADD_TO_CART",
                        "TOTAL_CLICK_CHECKOUT": "TOTAL_CLICK_CHECKOUT",
                        "TOTAL_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CLICK_LEAD": "TOTAL_CLICK_LEAD",
                        "TOTAL_CLICK_SIGNUP": "TOTAL_CLICK_SIGNUP",
                        "TOTAL_CLICK_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_CLICK_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_CONVERSIONS": "TOTAL_CONVERSIONS",
                        "TOTAL_CUSTOM": "TOTAL_CUSTOM",
                        "TOTAL_ENGAGEMENT": "TOTAL_ENGAGEMENT",
                        "TOTAL_ENGAGEMENT_CHECKOUT": "TOTAL_ENGAGEMENT_CHECKOUT",
                        "TOTAL_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_ENGAGEMENT_LEAD": "TOTAL_ENGAGEMENT_LEAD",
                        "TOTAL_ENGAGEMENT_SIGNUP": "TOTAL_ENGAGEMENT_SIGNUP",
                        "TOTAL_ENGAGEMENT_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_ENGAGEMENT_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_IDEA_PIN_PRODUCT_TAG_VISIT": "TOTAL_IDEA_PIN_PRODUCT_TAG_VISIT",
                        "TOTAL_IMPRESSION_FREQUENCY": "TOTAL_IMPRESSION_FREQUENCY",
                        "TOTAL_IMPRESSION_USER": "TOTAL_IMPRESSION_USER",
                        "TOTAL_LEAD": "TOTAL_LEAD",
                        "TOTAL_OFFLINE_CHECKOUT": "TOTAL_OFFLINE_CHECKOUT",
                        "TOTAL_PAGE_VISIT": "TOTAL_PAGE_VISIT",
                        "TOTAL_REPIN_RATE": "TOTAL_REPIN_RATE",
                        "TOTAL_SIGNUP": "TOTAL_SIGNUP",
                        "TOTAL_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_VIDEO_3SEC_VIEWS": "TOTAL_VIDEO_3SEC_VIEWS",
                        "TOTAL_VIDEO_AVG_WATCHTIME_IN_SECOND": "TOTAL_VIDEO_AVG_WATCHTIME_IN_SECOND",
                        "TOTAL_VIDEO_MRC_VIEWS": "TOTAL_VIDEO_MRC_VIEWS",
                        "TOTAL_VIDEO_P0_COMBINED": "TOTAL_VIDEO_P0_COMBINED",
                        "TOTAL_VIDEO_P100_COMPLETE": "TOTAL_VIDEO_P100_COMPLETE",
                        "TOTAL_VIDEO_P25_COMBINED": "TOTAL_VIDEO_P25_COMBINED",
                        "TOTAL_VIDEO_P50_COMBINED": "TOTAL_VIDEO_P50_COMBINED",
                        "TOTAL_VIDEO_P75_COMBINED": "TOTAL_VIDEO_P75_COMBINED",
                        "TOTAL_VIDEO_P95_COMBINED": "TOTAL_VIDEO_P95_COMBINED",
                        "TOTAL_VIEW_ADD_TO_CART": "TOTAL_VIEW_ADD_TO_CART",
                        "TOTAL_VIEW_CHECKOUT": "TOTAL_VIEW_CHECKOUT",
                        "TOTAL_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_VIEW_LEAD": "TOTAL_VIEW_LEAD",
                        "TOTAL_VIEW_SIGNUP": "TOTAL_VIEW_SIGNUP",
                        "TOTAL_VIEW_SIGNUP_VALUE_IN_MICRO_DOLLAR": "TOTAL_VIEW_SIGNUP_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_CHECKOUT": "TOTAL_WEB_CHECKOUT",
                        "TOTAL_WEB_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_CLICK_CHECKOUT": "TOTAL_WEB_CLICK_CHECKOUT",
                        "TOTAL_WEB_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_CLICK_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_ENGAGEMENT_CHECKOUT": "TOTAL_WEB_ENGAGEMENT_CHECKOUT",
                        "TOTAL_WEB_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_ENGAGEMENT_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "TOTAL_WEB_SESSIONS": "TOTAL_WEB_SESSIONS",
                        "TOTAL_WEB_VIEW_CHECKOUT": "TOTAL_WEB_VIEW_CHECKOUT",
                        "TOTAL_WEB_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR": "TOTAL_WEB_VIEW_CHECKOUT_VALUE_IN_MICRO_DOLLAR",
                        "VIDEO_3SEC_VIEWS_2": "VIDEO_3SEC_VIEWS_2",
                        "VIDEO_LENGTH": "VIDEO_LENGTH",
                        "VIDEO_MRC_VIEWS_2": "VIDEO_MRC_VIEWS_2",
                        "VIDEO_P0_COMBINED_2": "VIDEO_P0_COMBINED_2",
                        "VIDEO_P100_COMPLETE_2": "VIDEO_P100_COMPLETE_2",
                        "VIDEO_P25_COMBINED_2": "VIDEO_P25_COMBINED_2",
                        "VIDEO_P50_COMBINED_2": "VIDEO_P50_COMBINED_2",
                        "VIDEO_P75_COMBINED_2": "VIDEO_P75_COMBINED_2",
                        "VIDEO_P95_COMBINED_2": "VIDEO_P95_COMBINED_2",
                        "WEB_CHECKOUT_COST_PER_ACTION": "WEB_CHECKOUT_COST_PER_ACTION",
                        "WEB_CHECKOUT_ROAS": "WEB_CHECKOUT_ROAS",
                        "WEB_SESSIONS_1": "WEB_SESSIONS_1",
                        "WEB_SESSIONS_2": "WEB_SESSIONS_2"
                    },
                    ('click_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('engagement_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('view_window_days',): {

                        "1": 1,
                        "7": 7,
                        "30": 30,
                        "60": 60
                    },
                    ('conversion_report_time',): {

                        "AD_ACTION": "TIME_OF_AD_ACTION",
                        "CONVERSION": "TIME_OF_CONVERSION"
                    },
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                    'start_date':
                        (date,),
                    'end_date':
                        (date,),
                    'ad_ids':
                        ([str],),
                    'columns':
                        ([str],),
                    'granularity':
                        (Granularity,),
                    'click_window_days':
                        (int,),
                    'engagement_window_days':
                        (int,),
                    'view_window_days':
                        (int,),
                    'conversion_report_time':
                        (str,),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                    'start_date': 'start_date',
                    'end_date': 'end_date',
                    'ad_ids': 'ad_ids',
                    'columns': 'columns',
                    'granularity': 'granularity',
                    'click_window_days': 'click_window_days',
                    'engagement_window_days': 'engagement_window_days',
                    'view_window_days': 'view_window_days',
                    'conversion_report_time': 'conversion_report_time',
                },
                'location_map': {
                    'ad_account_id': 'path',
                    'start_date': 'query',
                    'end_date': 'query',
                    'ad_ids': 'query',
                    'columns': 'query',
                    'granularity': 'query',
                    'click_window_days': 'query',
                    'engagement_window_days': 'query',
                    'view_window_days': 'query',
                    'conversion_report_time': 'query',
                },
                'collection_format_map': {
                    'ad_ids': 'multi',
                    'columns': 'csv',
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.ads_create_endpoint = _Endpoint(
            settings={
                'response_type': (AdArrayResponse,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}/ads',
                'operation_id': 'ads_create',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                    'ad_create_request',
                ],
                'required': [
                    'ad_account_id',
                    'ad_create_request',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                    'ad_account_id',
                    'ad_create_request',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                    ('ad_create_request',): {

                        'max_items': 30,
                        'min_items': 1,
                    },
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                    'ad_create_request':
                        ([AdCreateRequest],),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                },
                'location_map': {
                    'ad_account_id': 'path',
                    'ad_create_request': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client
        )
        self.ads_get_endpoint = _Endpoint(
            settings={
                'response_type': (AdResponse,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}/ads/{ad_id}',
                'operation_id': 'ads_get',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                    'ad_id',
                ],
                'required': [
                    'ad_account_id',
                    'ad_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                    'ad_account_id',
                    'ad_id',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                    ('ad_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                    'ad_id':
                        (str,),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                    'ad_id': 'ad_id',
                },
                'location_map': {
                    'ad_account_id': 'path',
                    'ad_id': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.ads_list_endpoint = _Endpoint(
            settings={
                'response_type': (bool, date, datetime, dict, float, int, list, str, none_type,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}/ads',
                'operation_id': 'ads_list',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                    'campaign_ids',
                    'ad_group_ids',
                    'ad_ids',
                    'entity_statuses',
                    'page_size',
                    'order',
                    'bookmark',
                ],
                'required': [
                    'ad_account_id',
                ],
                'nullable': [
                ],
                'enum': [
                    'entity_statuses',
                    'order',
                ],
                'validation': [
                    'ad_account_id',
                    'campaign_ids',
                    'ad_group_ids',
                    'ad_ids',
                    'page_size',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                    ('campaign_ids',): {

                        'max_items': 100,
                        'min_items': 1,
                    },
                    ('ad_group_ids',): {

                        'max_items': 100,
                        'min_items': 1,
                    },
                    ('ad_ids',): {

                        'max_items': 100,
                        'min_items': 1,
                    },
                    ('page_size',): {

                        'inclusive_maximum': 250,
                        'inclusive_minimum': 1,
                    },
                },
                'allowed_values': {
                    ('entity_statuses',): {

                        "ACTIVE": "ACTIVE",
                        "PAUSED": "PAUSED",
                        "ARCHIVED": "ARCHIVED"
                    },
                    ('order',): {

                        "ASCENDING": "ASCENDING",
                        "DESCENDING": "DESCENDING"
                    },
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                    'campaign_ids':
                        ([str],),
                    'ad_group_ids':
                        ([str],),
                    'ad_ids':
                        ([str],),
                    'entity_statuses':
                        ([str],),
                    'page_size':
                        (int,),
                    'order':
                        (str,),
                    'bookmark':
                        (str,),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                    'campaign_ids': 'campaign_ids',
                    'ad_group_ids': 'ad_group_ids',
                    'ad_ids': 'ad_ids',
                    'entity_statuses': 'entity_statuses',
                    'page_size': 'page_size',
                    'order': 'order',
                    'bookmark': 'bookmark',
                },
                'location_map': {
                    'ad_account_id': 'path',
                    'campaign_ids': 'query',
                    'ad_group_ids': 'query',
                    'ad_ids': 'query',
                    'entity_statuses': 'query',
                    'page_size': 'query',
                    'order': 'query',
                    'bookmark': 'query',
                },
                'collection_format_map': {
                    'campaign_ids': 'multi',
                    'ad_group_ids': 'multi',
                    'ad_ids': 'multi',
                    'entity_statuses': 'multi',
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.ads_update_endpoint = _Endpoint(
            settings={
                'response_type': (AdArrayResponse,),
                'auth': [
                    'pinterest_oauth2'
                ],
                'endpoint_path': '/ad_accounts/{ad_account_id}/ads',
                'operation_id': 'ads_update',
                'http_method': 'PATCH',
                'servers': None,
            },
            params_map={
                'all': [
                    'ad_account_id',
                    'ad_update_request',
                ],
                'required': [
                    'ad_account_id',
                    'ad_update_request',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                    'ad_account_id',
                    'ad_update_request',
                ]
            },
            root_map={
                'validations': {
                    ('ad_account_id',): {
                        'max_length': 18,
                        'regex': {
                            'pattern': r'^\d+$',  # noqa: E501
                        },
                    },
                    ('ad_update_request',): {

                        'max_items': 30,
                        'min_items': 1,
                    },
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'ad_account_id':
                        (str,),
                    'ad_update_request':
                        ([AdUpdateRequest],),
                },
                'attribute_map': {
                    'ad_account_id': 'ad_account_id',
                },
                'location_map': {
                    'ad_account_id': 'path',
                    'ad_update_request': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client
        )

    def ad_previews_create(
        self,
        ad_account_id,
        ad_preview_request,
        **kwargs
    ):
        """Create ad preview with pin or image  # noqa: E501

        Create an ad preview given an ad account ID and either an existing organic pin ID or the URL for an image to be used to create the Pin and the ad. <p/> If you are creating a preview from an existing Pin, that Pin must be promotable: that is, it must have a clickthrough link and meet other requirements. (See <a href=\"https://help.pinterest.com/en/business/article/promoted-pins-overview\" target=\"_blank\">Ads Overview</a>.) <p/> You can view the returned preview URL on a webpage or iframe for 7 days, after which the URL expires.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ad_previews_create(ad_account_id, ad_preview_request, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.
            ad_preview_request (AdPreviewRequest): Create ad preview with pin or image.

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            AdPreviewURLResponse
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        kwargs['ad_preview_request'] = \
            ad_preview_request
        return self.ad_previews_create_endpoint.call_with_http_info(**kwargs)

    def ad_targeting_analytics_get(
        self,
        ad_account_id,
        ad_ids,
        start_date,
        end_date,
        targeting_types,
        columns,
        granularity,
        **kwargs
    ):
        """Get targeting analytics for ads  # noqa: E501

        <strong>This endpoint is currently in beta and not available to all apps. <a href='/docs/features/ads-management/'>Learn more</a>.</strong> <p/> Get targeting analytics for one or more ads. For the requested ad(s) and metrics, the response will include the requested metric information (e.g. SPEND_IN_DOLLAR) for the requested target type (e.g. \"age_bucket\") for applicable values (e.g. \"45-49\"). <p/> - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href=\"https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts\">Business Access</a>: Admin, Analyst, Campaign Manager.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ad_targeting_analytics_get(ad_account_id, ad_ids, start_date, end_date, targeting_types, columns, granularity, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.
            ad_ids ([str]): List of Ad Ids to use to filter the results.
            start_date (date): Metric report start date (UTC). Format: YYYY-MM-DD
            end_date (date): Metric report end date (UTC). Format: YYYY-MM-DD
            targeting_types ([AdsAnalyticsTargetingType]): Targeting type breakdowns for the report. The reporting per targeting type <br> is independent from each other.
            columns ([str]): Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
            granularity (Granularity): TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly

        Keyword Args:
            click_window_days (int): Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.. [optional] if omitted the server will use the default value of 30
            engagement_window_days (int): Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.. [optional] if omitted the server will use the default value of 30
            view_window_days (int): Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.. [optional] if omitted the server will use the default value of 1
            conversion_report_time (str): The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.. [optional] if omitted the server will use the default value of "TIME_OF_AD_ACTION"
            attribution_types (ConversionReportAttributionType): List of types of attribution for the conversion report. [optional]
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            MetricsResponse
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        kwargs['ad_ids'] = \
            ad_ids
        kwargs['start_date'] = \
            start_date
        kwargs['end_date'] = \
            end_date
        kwargs['targeting_types'] = \
            targeting_types
        kwargs['columns'] = \
            columns
        kwargs['granularity'] = \
            granularity
        return self.ad_targeting_analytics_get_endpoint.call_with_http_info(**kwargs)

    def ads_analytics(
        self,
        ad_account_id,
        start_date,
        end_date,
        ad_ids,
        columns,
        granularity,
        **kwargs
    ):
        """Get ad analytics  # noqa: E501

        Get analytics for the specified ads in the specified <code>ad_account_id</code>, filtered by the specified options. - The token's user_account must either be the Owner of the specified ad account, or have one of the necessary roles granted to them via <a href=\"https://help.pinterest.com/en/business/article/share-and-manage-access-to-your-ad-accounts\">Business Access</a>: Admin, Analyst, Campaign Manager.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ads_analytics(ad_account_id, start_date, end_date, ad_ids, columns, granularity, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.
            start_date (date): Metric report start date (UTC). Format: YYYY-MM-DD
            end_date (date): Metric report end date (UTC). Format: YYYY-MM-DD
            ad_ids ([str]): List of Ad Ids to use to filter the results.
            columns ([str]): Columns to retrieve, encoded as a comma-separated string. **NOTE**: Any metrics defined as MICRO_DOLLARS returns a value based on the advertiser profile's currency field. For USD,($1/1,000,000, or $0.000001 - one one-ten-thousandth of a cent). it's microdollars. Otherwise, it's in microunits of the advertiser's currency.<br/>For example, if the advertiser's currency is GBP (British pound sterling), all MICRO_DOLLARS fields will be in GBP microunits (1/1,000,000 British pound).<br/>If a column has no value, it may not be returned
            granularity (Granularity): TOTAL - metrics are aggregated over the specified date range.<br> DAY - metrics are broken down daily.<br> HOUR - metrics are broken down hourly.<br>WEEKLY - metrics are broken down weekly.<br>MONTHLY - metrics are broken down monthly

        Keyword Args:
            click_window_days (int): Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.. [optional] if omitted the server will use the default value of 30
            engagement_window_days (int): Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `30` days.. [optional] if omitted the server will use the default value of 30
            view_window_days (int): Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to `1` day.. [optional] if omitted the server will use the default value of 1
            conversion_report_time (str): The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.. [optional] if omitted the server will use the default value of "TIME_OF_AD_ACTION"
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            AdsAnalyticsResponse
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        kwargs['start_date'] = \
            start_date
        kwargs['end_date'] = \
            end_date
        kwargs['ad_ids'] = \
            ad_ids
        kwargs['columns'] = \
            columns
        kwargs['granularity'] = \
            granularity
        return self.ads_analytics_endpoint.call_with_http_info(**kwargs)

    def ads_create(
        self,
        ad_account_id,
        ad_create_request,
        **kwargs
    ):
        """Create ads  # noqa: E501

        Create multiple new ads. Request must contain ad_group_id, creative_type, and the source Pin pin_id.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ads_create(ad_account_id, ad_create_request, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.
            ad_create_request ([AdCreateRequest]): List of ads to create, size limit [1, 30].

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            AdArrayResponse
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        kwargs['ad_create_request'] = \
            ad_create_request
        return self.ads_create_endpoint.call_with_http_info(**kwargs)

    def ads_get(
        self,
        ad_account_id,
        ad_id,
        **kwargs
    ):
        """Get ad  # noqa: E501

        Get a specific ad given the ad ID. If your pin is rejected, rejected_reasons will contain additional information from the Ad Review process. For more information about our policies and rejection reasons see the <a href=\"https://www.pinterest.com/_/_/policy/advertising-guidelines/\" target=\"_blank\">Pinterest advertising standards</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ads_get(ad_account_id, ad_id, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.
            ad_id (str): Unique identifier of an ad.

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            AdResponse
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        kwargs['ad_id'] = \
            ad_id
        return self.ads_get_endpoint.call_with_http_info(**kwargs)

    def ads_list(
        self,
        ad_account_id,
        **kwargs
    ):
        """List ads  # noqa: E501

        List ads that meet the filters provided:   - Listed campaign ids or ad group ids or ad ids   - Listed entity statuses <p/> If no filter is provided, all ads in the ad account are returned. <p/> <strong>Note:</strong><p/> Provide only campaign_id or ad_group_id or ad_id. Do not provide more than one type. <p/> Review status is provided for each ad; if review_status is REJECTED, the rejected_reasons field will contain additional information. For more, see <a href=\"https://policy.pinterest.com/en/advertising-guidelines\">Pinterest advertising standards</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ads_list(ad_account_id, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.

        Keyword Args:
            campaign_ids ([str]): List of Campaign Ids to use to filter the results.. [optional]
            ad_group_ids ([str]): List of Ad group Ids to use to filter the results.. [optional]
            ad_ids ([str]): List of Ad Ids to use to filter the results.. [optional]
            entity_statuses ([str]): Entity status. [optional]
            page_size (int): Maximum number of items to include in a single page of the response. See documentation on <a href='/docs/getting-started/pagination/'>Pagination</a> for more information.. [optional] if omitted the server will use the default value of 25
            order (str): The order in which to sort the items returned: “ASCENDING” or “DESCENDING” by ID. Note that higher-value IDs are associated with more-recently added items.. [optional]
            bookmark (str): Cursor used to fetch the next page of items. [optional]
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            bool, date, datetime, dict, float, int, list, str, none_type
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        return self.ads_list_endpoint.call_with_http_info(**kwargs)

    def ads_update(
        self,
        ad_account_id,
        ad_update_request,
        **kwargs
    ):
        """Update ads  # noqa: E501

        Update multiple existing ads  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.ads_update(ad_account_id, ad_update_request, async_req=True)
        >>> result = thread.get()

        Args:
            ad_account_id (str): Unique identifier of an ad account.
            ad_update_request ([AdUpdateRequest]): List of ads to update, size limit [1, 30]

        Keyword Args:
            _return_http_data_only (bool): response data without head status
                code and headers. Default is True.
            _preload_content (bool): if False, the urllib3.HTTPResponse object
                will be returned without reading/decoding response data.
                Default is True.
            _request_timeout (int/float/tuple): timeout setting for this request. If
                one number provided, it will be total request timeout. It can also
                be a pair (tuple) of (connection, read) timeouts.
                Default is None.
            _check_input_type (bool): specifies if type checking
                should be done one the data sent to the server.
                Default is True.
            _check_return_type (bool): specifies if type checking
                should be done one the data received from the server.
                Default is True.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            async_req (bool): execute request asynchronously

        Returns:
            AdArrayResponse
                If the method is called asynchronously, returns the request
                thread.
        """
        kwargs['async_req'] = kwargs.get(
            'async_req', False
        )
        kwargs['_return_http_data_only'] = kwargs.get(
            '_return_http_data_only', True
        )
        kwargs['_preload_content'] = kwargs.get(
            '_preload_content', True
        )
        kwargs['_request_timeout'] = kwargs.get(
            '_request_timeout', None
        )
        kwargs['_check_input_type'] = kwargs.get(
            '_check_input_type', True
        )
        kwargs['_check_return_type'] = kwargs.get(
            '_check_return_type', True
        )
        kwargs['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['ad_account_id'] = \
            ad_account_id
        kwargs['ad_update_request'] = \
            ad_update_request
        return self.ads_update_endpoint.call_with_http_info(**kwargs)

